import { Component, OnInit } from '@angular/core';
import { HttpService } from '../../services/http.service';  
// 请求
import {Http} from '@angular/http';
import 'rxjs/add/operator/toPromise'

declare var $:any;
@Component({
  selector: 'app-menuleft',
  templateUrl: './menuleft.component.html',
  styleUrls: ['./menuleft.component.css']
})
export class MenuleftComponent implements OnInit {
  // http://192.168.10.168:9002/api/ProductBigCategory
  alldata=[];
  classify1;
  classify2;
  classify3;
  classify4;
  classify5;
  classify6;
  classify7;
  classify8;
  classify9;
  classify10;
  classify11;
  classify12;
  menuleftone1=false;
  menuleftone2=false;
  menuleftone3=false;
  menuleftone4=false;
  menuleftone5=false;
  menuleftone6=false;
  menuleftone7=false;
  menuleftone8=false;
  menuleftone9=false;
  menuleftone10=false;
  menuleftone11=false;
  menuleftone12=false;

  constructor(private httpService:HttpService,private http:Http) { }

  ngOnInit() {
    let url = 'http://192.168.10.168:9002/api/ProductBigCategory'
        this.httpService.httpGet(url).subscribe(res =>{
          for(var i=0;i<12;i++){
              this.alldata.push(res.data[i]);
          }
          console.log(this.alldata[0].Name);
          this.classify1=this.alldata[0].Name;
          this.classify2=this.alldata[1].Name;
          this.classify3=this.alldata[2].Name;
          this.classify4=this.alldata[3].Name;
          this.classify5=this.alldata[4].Name;
          this.classify6=this.alldata[5].Name;
          this.classify7=this.alldata[6].Name;
          this.classify8=this.alldata[7].Name;
          this.classify9=this.alldata[8].Name;
          this.classify10=this.alldata[9].Name;
          this.classify11=this.alldata[10].Name;
          this.classify12=this.alldata[11].Name;


       }); 
  }

  one1(){
    this.menuleftone1 = true;
    this.menuleftone2=false;
    this.menuleftone3=false;
    this.menuleftone4=false;
    this.menuleftone5=false;
    this.menuleftone6=false;
    this.menuleftone7=false;
    this.menuleftone8=false;
    this.menuleftone9=false;
    this.menuleftone10=false;
    this.menuleftone11=false;
    this.menuleftone12=false;
  }
  one2(){
    this.menuleftone1=false;
    this.menuleftone2=true;
    this.menuleftone3=false;
    this.menuleftone4=false;
    this.menuleftone5=false;
    this.menuleftone6=false;
    this.menuleftone7=false;
    this.menuleftone8=false;
    this.menuleftone9=false;
    this.menuleftone10=false;
    this.menuleftone11=false;
    this.menuleftone12=false;
  }
  one3(){
    this.menuleftone1=false;
    this.menuleftone2=false;
    this.menuleftone3=true;
    this.menuleftone4=false;
    this.menuleftone5=false;
    this.menuleftone6=false;
    this.menuleftone7=false;
    this.menuleftone8=false;
    this.menuleftone9=false;
    this.menuleftone10=false;
    this.menuleftone11=false;
    this.menuleftone12=false;
  }
  one4(){
    this.menuleftone1=false;
    this.menuleftone2=false;
    this.menuleftone3=false;
    this.menuleftone4=true;
    this.menuleftone5=false;
    this.menuleftone6=false;
    this.menuleftone7=false;
    this.menuleftone8=false;
    this.menuleftone9=false;
    this.menuleftone10=false;
    this.menuleftone11=false;
    this.menuleftone12=false;
  }
  one5(){
    this.menuleftone1=false;
    this.menuleftone2=false;
    this.menuleftone3=false;
    this.menuleftone4=false;
    this.menuleftone5=true;
    this.menuleftone6=false;
    this.menuleftone7=false;
    this.menuleftone8=false;
    this.menuleftone9=false;
    this.menuleftone10=false;
    this.menuleftone11=false;
    this.menuleftone12=false;
  }
  one6(){
    this.menuleftone1=false;
    this.menuleftone2=false;
    this.menuleftone3=false;
    this.menuleftone4=false;
    this.menuleftone5=false;
    this.menuleftone6=true;
    this.menuleftone7=false;
    this.menuleftone8=false;
    this.menuleftone9=false;
    this.menuleftone10=false;
    this.menuleftone11=false;
    this.menuleftone12=false;
  }
  one7(){
    this.menuleftone1=false;
    this.menuleftone2=false;
    this.menuleftone3=false;
    this.menuleftone4=false;
    this.menuleftone5=false;
    this.menuleftone6=false;
    this.menuleftone7=true;
    this.menuleftone8=false;
    this.menuleftone9=false;
    this.menuleftone10=false;
    this.menuleftone11=false;
    this.menuleftone12=false;
  }
  one8(){
    this.menuleftone1=false;
    this.menuleftone2=false;
    this.menuleftone3=false;
    this.menuleftone4=false;
    this.menuleftone5=false;
    this.menuleftone6=false;
    this.menuleftone7=false;
    this.menuleftone8=true;
    this.menuleftone9=false;
    this.menuleftone10=false;
    this.menuleftone11=false;
    this.menuleftone12=false;
  }
  one9(){
    this.menuleftone1=false;
    this.menuleftone2=false;
    this.menuleftone3=false;
    this.menuleftone4=false;
    this.menuleftone5=false;
    this.menuleftone6=false;
    this.menuleftone7=false;
    this.menuleftone8=false;
    this.menuleftone9=true;
    this.menuleftone10=false;
    this.menuleftone11=false;
    this.menuleftone12=false;
  }
  one10(){
    this.menuleftone1=false;
    this.menuleftone2=false;
    this.menuleftone3=false;
    this.menuleftone4=false;
    this.menuleftone5=false;
    this.menuleftone6=false;
    this.menuleftone7=false;
    this.menuleftone8=false;
    this.menuleftone9=false;
    this.menuleftone10=true;
    this.menuleftone11=false;
    this.menuleftone12=false;
  }
  one11(){
    this.menuleftone1=false;
    this.menuleftone2=false;
    this.menuleftone3=false;
    this.menuleftone4=false;
    this.menuleftone5=false;
    this.menuleftone6=false;
    this.menuleftone7=false;
    this.menuleftone8=false;
    this.menuleftone9=false;
    this.menuleftone10=false;
    this.menuleftone11=true;
    this.menuleftone12=false;
  }
  one12(){
    this.menuleftone1=false;
    this.menuleftone2=false;
    this.menuleftone3=false;
    this.menuleftone4=false;
    this.menuleftone5=false;
    this.menuleftone6=false;
    this.menuleftone7=false;
    this.menuleftone8=false;
    this.menuleftone9=false;
    this.menuleftone10=false;
    this.menuleftone11=false;
    this.menuleftone12=true;
  }


}
